<!DOCTYPE html>
<html lang="zh-CN" th:replace="~{layout :: layout(~{::title}, ~{::content}, ~{::script})}">
<head>
    <title th:text="${page.spec.title ?: 'Contact Us'} + ' - ' + ${site.title ?: '机械设备制造商'}">Contact Us</title>
</head>
<body>
    <th:block th:fragment="content">
        <!-- Page Header -->
        <section class="page-header">
            <div class="container">
                <div class="page-header-content">
                    <h1 class="page-title" th:text="${page.spec.title}">Contact Us</h1>
                    <nav class="breadcrumb">
                        <a href="/" class="breadcrumb-item">Home</a>
                        <span class="breadcrumb-separator">/</span>
                        <span class="breadcrumb-item active" th:text="${page.spec.title}">Contact Us</span>
                    </nav>
                </div>
            </div>
        </section>
        
        <!-- Contact Hero Section -->
        <section class="contact-hero">
            <div class="container">
                <div class="contact-hero-content">
                    <div class="hero-text">
                        <h2>Get in Touch with Our Experts</h2>
                        <p>Ready to discuss your industrial machinery needs? Our experienced team is here to provide professional consultation and customized solutions for your business.</p>
                        <div class="hero-features">
                            <div class="feature-item">
                                <i class="fas fa-clock"></i>
                                <span>24/7 Technical Support</span>
                            </div>
                            <div class="feature-item">
                                <i class="fas fa-shipping-fast"></i>
                                <span>Global Shipping Available</span>
                            </div>
                            <div class="feature-item">
                                <i class="fas fa-certificate"></i>
                                <span>ISO Certified Quality</span>
                            </div>
                        </div>
                    </div>
                    <div class="hero-image">
                        <img src="https://trae-api-sg.mchost.guru/api/ide/v1/text_to_image?prompt=Professional%20industrial%20machinery%20factory%20with%20modern%20equipment%20and%20workers%20in%20safety%20gear%2C%20clean%20manufacturing%20environment%2C%20blue%20industrial%20theme&image_size=landscape_4_3" alt="Industrial Manufacturing">
                    </div>
                </div>
            </div>
        </section>
        
        <!-- Contact Information Cards -->
        <section class="contact-info-section">
            <div class="container">
                <div class="section-header">
                    <h2>Multiple Ways to Reach Us</h2>
                    <p>Choose the most convenient way to contact our team</p>
                </div>
                <div class="contact-cards-grid">
                    <div class="contact-card">
                        <div class="contact-icon">
                            <i class="fas fa-building"></i>
                        </div>
                        <div class="contact-content">
                            <h4>Head Office</h4>
                            <p class="contact-address">No. 168 Industrial Park Road<br>Machinery District, Shanghai 200000<br>China</p>
                            <div class="contact-details">
                                <span class="detail-item">
                                    <i class="fas fa-clock"></i>
                                    Mon-Fri: 8:00-18:00 (GMT+8)
                                </span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="contact-card">
                        <div class="contact-icon">
                            <i class="fas fa-phone-alt"></i>
                        </div>
                        <div class="contact-content">
                            <h4>Phone & Fax</h4>
                            <p class="contact-phone">+86-21-6789-1234</p>
                            <p class="contact-fax">Fax: +86-21-6789-1235</p>
                            <div class="contact-details">
                                <span class="detail-item">
                                    <i class="fas fa-headset"></i>
                                    24/7 Emergency Support
                                </span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="contact-card">
                        <div class="contact-icon">
                            <i class="fas fa-envelope"></i>
                        </div>
                        <div class="contact-content">
                            <h4>Email Contact</h4>
                            <p><a href="mailto:sales@machinery-company.com">sales@machinery-company.com</a></p>
                            <p><a href="mailto:support@machinery-company.com">support@machinery-company.com</a></p>
                            <div class="contact-details">
                                <span class="detail-item">
                                    <i class="fas fa-reply"></i>
                                    Response within 2 hours
                                </span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="contact-card">
                        <div class="contact-icon">
                            <i class="fas fa-globe"></i>
                        </div>
                        <div class="contact-content">
                            <h4>International Trade</h4>
                            <p>Export Manager: John Smith</p>
                            <p>WhatsApp: +86-138-0000-1234</p>
                            <div class="contact-details">
                                <span class="detail-item">
                                    <i class="fas fa-language"></i>
                                    English, Chinese, Spanish
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- Inquiry Form Section -->
        <section class="inquiry-form-section">
            <div class="container">
                <div class="inquiry-wrapper">
                    <div class="inquiry-content">
                        <div class="inquiry-header">
                            <h2>Request a Quote</h2>
                            <p>Tell us about your project requirements and we'll provide a detailed quotation within 24 hours.</p>
                        </div>
                        
                        <form class="inquiry-form" id="inquiryForm" action="/contact" method="post">
                            <div class="form-row">
                                <div class="form-group">
                                    <label for="fullName">Full Name *</label>
                                    <input type="text" id="fullName" name="fullName" class="form-control" required>
                                </div>
                                <div class="form-group">
                                    <label for="email">Email Address *</label>
                                    <input type="email" id="email" name="email" class="form-control" required>
                                </div>
                            </div>
                            
                            <div class="form-row">
                                <div class="form-group">
                                    <label for="phone">Phone Number *</label>
                                    <input type="tel" id="phone" name="phone" class="form-control" required>
                                </div>
                                <div class="form-group">
                                    <label for="company">Company Name *</label>
                                    <input type="text" id="company" name="company" class="form-control" required>
                                </div>
                            </div>
                            
                            <div class="form-row">
                                <div class="form-group">
                                    <label for="country">Country/Region *</label>
                                    <select id="country" name="country" class="form-control" required>
                                        <option value="">Select your country</option>
                                        <option value="US">United States</option>
                                        <option value="UK">United Kingdom</option>
                                        <option value="DE">Germany</option>
                                        <option value="FR">France</option>
                                        <option value="IT">Italy</option>
                                        <option value="ES">Spain</option>
                                        <option value="CA">Canada</option>
                                        <option value="AU">Australia</option>
                                        <option value="JP">Japan</option>
                                        <option value="KR">South Korea</option>
                                        <option value="IN">India</option>
                                        <option value="BR">Brazil</option>
                                        <option value="MX">Mexico</option>
                                        <option value="RU">Russia</option>
                                        <option value="OTHER">Other</option>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="industry">Industry *</label>
                                    <select id="industry" name="industry" class="form-control" required>
                                        <option value="">Select your industry</option>
                                        <option value="automotive">Automotive</option>
                                        <option value="aerospace">Aerospace</option>
                                        <option value="oil_gas">Oil & Gas</option>
                                        <option value="chemical">Chemical Processing</option>
                                        <option value="power_generation">Power Generation</option>
                                        <option value="marine">Marine</option>
                                        <option value="mining">Mining</option>
                                        <option value="construction">Construction</option>
                                        <option value="food_beverage">Food & Beverage</option>
                                        <option value="pharmaceutical">Pharmaceutical</option>
                                        <option value="other">Other</option>
                                    </select>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label for="productCategory">Product Category *</label>
                                <select id="productCategory" name="productCategory" class="form-control" required>
                                    <option value="">Select product category</option>
                                    <option value="industrial_valves">Industrial Valves</option>
                                    <option value="precision_bearings">Precision Bearings</option>
                                    <option value="transmission_devices">Transmission Devices</option>
                                    <option value="sealing_solutions">Sealing Solutions</option>
                                    <option value="custom_machinery">Custom Machinery</option>
                                    <option value="spare_parts">Spare Parts</option>
                                    <option value="other">Other</option>
                                </select>
                            </div>
                            
                            <div class="form-row">
                                <div class="form-group">
                                    <label for="quantity">Estimated Quantity</label>
                                    <input type="text" id="quantity" name="quantity" class="form-control" placeholder="e.g., 100 pieces, 50 sets">
                                </div>
                                <div class="form-group">
                                    <label for="budget">Budget Range (USD)</label>
                                    <select id="budget" name="budget" class="form-control">
                                        <option value="">Select budget range</option>
                                        <option value="under_10k">Under $10,000</option>
                                        <option value="10k_50k">$10,000 - $50,000</option>
                                        <option value="50k_100k">$50,000 - $100,000</option>
                                        <option value="100k_500k">$100,000 - $500,000</option>
                                        <option value="over_500k">Over $500,000</option>
                                    </select>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label for="requirements">Detailed Requirements *</label>
                                <textarea id="requirements" name="requirements" class="form-control" rows="6" required 
                                          placeholder="Please provide detailed specifications, technical requirements, application conditions, delivery timeline, and any other relevant information..."></textarea>
                            </div>
                            
                            <div class="form-group">
                                <label for="timeline">Project Timeline</label>
                                <select id="timeline" name="timeline" class="form-control">
                                    <option value="">Select timeline</option>
                                    <option value="urgent">Urgent (Within 1 month)</option>
                                    <option value="normal">Normal (1-3 months)</option>
                                    <option value="flexible">Flexible (3+ months)</option>
                                </select>
                            </div>
                            
                            <div class="form-group checkbox-group">
                                <div class="checkbox-item">
                                    <input type="checkbox" id="sampleRequest" name="sampleRequest" class="form-check-input">
                                    <label for="sampleRequest" class="form-check-label">
                                        I would like to request product samples
                                    </label>
                                </div>
                                <div class="checkbox-item">
                                    <input type="checkbox" id="technicalDrawing" name="technicalDrawing" class="form-check-input">
                                    <label for="technicalDrawing" class="form-check-label">
                                        I can provide technical drawings or specifications
                                    </label>
                                </div>
                                <div class="checkbox-item">
                                    <input type="checkbox" id="newsletter" name="newsletter" class="form-check-input">
                                    <label for="newsletter" class="form-check-label">
                                        Subscribe to our newsletter for industry updates
                                    </label>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" id="agree" name="agree" class="form-check-input" required>
                                    <label for="agree" class="form-check-label">
                                        I agree to the <a href="/privacy" target="_blank">Privacy Policy</a> and consent to the processing of my personal data for business purposes.
                                    </label>
                                </div>
                            </div>
                            
                            <div class="form-actions">
                                <button type="submit" class="btn btn-primary btn-lg">
                                    <i class="fas fa-paper-plane"></i>
                                    Send Inquiry
                                </button>
                                <p class="form-note">
                                    <i class="fas fa-shield-alt"></i>
                                    Your information is secure and will only be used for business communication.
                                </p>
                            </div>
                        </form>
                    </div>
                    
                    <div class="inquiry-sidebar">
                        <div class="sidebar-widget">
                            <h3>Why Choose Us?</h3>
                            <div class="advantage-list">
                                <div class="advantage-item">
                                    <i class="fas fa-award"></i>
                                    <div>
                                        <h4>13+ Years Experience</h4>
                                        <p>Proven track record in industrial machinery</p>
                                    </div>
                                </div>
                                <div class="advantage-item">
                                    <i class="fas fa-globe"></i>
                                    <div>
                                        <h4>Global Reach</h4>
                                        <p>Exported to 80+ countries worldwide</p>
                                    </div>
                                </div>
                                <div class="advantage-item">
                                    <i class="fas fa-certificate"></i>
                                    <div>
                                        <h4>Quality Certified</h4>
                                        <p>ISO 9001, CE, API certified products</p>
                                    </div>
                                </div>
                                <div class="advantage-item">
                                    <i class="fas fa-tools"></i>
                                    <div>
                                        <h4>Custom Solutions</h4>
                                        <p>Tailored products for specific needs</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="sidebar-widget">
                            <h3>Response Time</h3>
                            <div class="response-timeline">
                                <div class="timeline-item">
                                    <div class="timeline-icon">
                                        <i class="fas fa-clock"></i>
                                    </div>
                                    <div class="timeline-content">
                                        <h4>Initial Response</h4>
                                        <p>Within 2 hours during business hours</p>
                                    </div>
                                </div>
                                <div class="timeline-item">
                                    <div class="timeline-icon">
                                        <i class="fas fa-file-alt"></i>
                                    </div>
                                    <div class="timeline-content">
                                        <h4>Detailed Quotation</h4>
                                        <p>Within 24 hours with specifications</p>
                                    </div>
                                </div>
                                <div class="timeline-item">
                                    <div class="timeline-icon">
                                        <i class="fas fa-shipping-fast"></i>
                                    </div>
                                    <div class="timeline-content">
                                        <h4>Sample Delivery</h4>
                                        <p>3-7 days for standard products</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="sidebar-widget contact-widget">
                            <h3>Need Immediate Help?</h3>
                            <div class="quick-contact">
                                <a href="tel:+862167891234" class="quick-contact-btn phone">
                                    <i class="fas fa-phone"></i>
                                    <span>Call Now</span>
                                </a>
                                <a href="https://wa.me/8613800001234" class="quick-contact-btn whatsapp" target="_blank">
                                    <i class="fab fa-whatsapp"></i>
                                    <span>WhatsApp</span>
                                </a>
                                <a href="mailto:sales@machinery-company.com" class="quick-contact-btn email">
                                    <i class="fas fa-envelope"></i>
                                    <span>Email Us</span>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- Company Location Section -->
        <section class="company-location">
            <div class="container">
                <div class="location-wrapper">
                    <div class="location-content">
                        <h2>Visit Our Facility</h2>
                        <p>We welcome customers to visit our modern manufacturing facility and see our quality control processes firsthand.</p>
                        
                        <div class="location-details">
                            <div class="detail-item">
                                <i class="fas fa-map-marker-alt"></i>
                                <div>
                                    <h4>Manufacturing Plant</h4>
                                    <p>No. 168 Industrial Park Road, Machinery District<br>Shanghai 200000, China</p>
                                </div>
                            </div>
                            <div class="detail-item">
                                <i class="fas fa-car"></i>
                                <div>
                                    <h4>Transportation</h4>
                                    <p>30 minutes from Shanghai Pudong Airport<br>Free pickup service available</p>
                                </div>
                            </div>
                            <div class="detail-item">
                                <i class="fas fa-calendar-alt"></i>
                                <div>
                                    <h4>Visit Hours</h4>
                                    <p>Monday - Friday: 9:00 AM - 5:00 PM<br>Appointment required</p>
                                </div>
                            </div>
                        </div>
                        
                        <a href="#" class="btn btn-outline btn-lg" onclick="document.getElementById('requirements').value='I would like to schedule a factory visit'; document.getElementById('inquiryForm').scrollIntoView();">
                            <i class="fas fa-calendar-plus"></i>
                            Schedule a Visit
                        </a>
                    </div>
                    
                    <div class="location-image">
                        <img src="https://trae-api-sg.mchost.guru/api/ide/v1/text_to_image?prompt=Modern%20industrial%20factory%20building%20exterior%20with%20company%20signage%2C%20clean%20architecture%2C%20blue%20industrial%20theme%2C%20professional%20manufacturing%20facility&image_size=landscape_4_3" alt="Our Manufacturing Facility">
                        <div class="location-overlay">
                            <div class="overlay-content">
                                <h3>State-of-the-Art Facility</h3>
                                <p>50,000 sqm manufacturing space</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </th:block>
    
    <th:block th:fragment="script">
        <script>
            // Form handling and validation
            document.getElementById('inquiryForm').addEventListener('submit', function(e) {
                e.preventDefault();
                
                // Validate required fields
                const requiredFields = this.querySelectorAll('[required]');
                let isValid = true;
                
                requiredFields.forEach(field => {
                    if (!field.value.trim()) {
                        field.classList.add('error');
                        isValid = false;
                    } else {
                        field.classList.remove('error');
                    }
                });
                
                // Email validation
                const email = document.getElementById('email');
                const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
                if (!emailRegex.test(email.value)) {
                    email.classList.add('error');
                    isValid = false;
                }
                
                if (isValid) {
                    // Show loading state
                    const submitBtn = this.querySelector('button[type="submit"]');
                    const originalText = submitBtn.innerHTML;
                    submitBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Sending Inquiry...';
                    submitBtn.disabled = true;
                    
                    // Simulate form submission
                    setTimeout(() => {
                        // Show success message
                        const successMessage = document.createElement('div');
                        successMessage.className = 'alert alert-success';
                        successMessage.innerHTML = `
                            <i class="fas fa-check-circle"></i>
                            <strong>Thank you for your inquiry!</strong><br>
                            We have received your request and will contact you within 24 hours with a detailed quotation.
                        `;
                        
                        this.parentNode.insertBefore(successMessage, this);
                        this.reset();
                        submitBtn.innerHTML = originalText;
                        submitBtn.disabled = false;
                        
                        // Scroll to success message
                        successMessage.scrollIntoView({ behavior: 'smooth' });
                        
                        // Remove success message after 10 seconds
                        setTimeout(() => {
                            successMessage.remove();
                        }, 10000);
                    }, 2000);
                }
            });
            
            // Form field focus effects
            document.querySelectorAll('.form-control').forEach(input => {
                input.addEventListener('focus', function() {
                    this.parentElement.classList.add('focused');
                });
                
                input.addEventListener('blur', function() {
                    if (!this.value) {
                        this.parentElement.classList.remove('focused');
                    }
                    this.classList.remove('error');
                });
            });
            
            // Animate elements on scroll
            function animateOnScroll() {
                const elements = document.querySelectorAll('.contact-card, .advantage-item, .timeline-item');
                
                const observer = new IntersectionObserver((entries) => {
                    entries.forEach((entry, index) => {
                        if (entry.isIntersecting) {
                            setTimeout(() => {
                                entry.target.style.opacity = '1';
                                entry.target.style.transform = 'translateY(0)';
                            }, index * 100);
                        }
                    });
                }, { threshold: 0.1 });
                
                elements.forEach(element => {
                    element.style.opacity = '0';
                    element.style.transform = 'translateY(30px)';
                    element.style.transition = 'all 0.6s ease';
                    observer.observe(element);
                });
            }
            
            // Initialize animations when page loads
            document.addEventListener('DOMContentLoaded', animateOnScroll);
        </script>
    </th:block>
</body>
</html>